import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const Home = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/home.vue')

const Authentication = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/authentication.vue')

const Authtelphone = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/authTelphone.vue')

const Loankind = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/loanKind.vue')

const Loanway = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/loanWay.vue')

const Repaymoney = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/repayMoney.vue')

const Selecttime = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/selectTime.vue')

const Booksuccess = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/bookSuccess.vue')

const Repayconfirm = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/repayConfirm.vue')

const Changeloanway = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/changeLoanWay.vue')

const Changeloantime = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/changeLoanTime.vue')

const Changeloandeadline = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/changeLoanDeadline.vue')

const Change = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/change.vue')

const Get = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/get.vue')

const Consult = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/consult.vue')

const Consultonline = () =>
    import( /* webpackChunkName: "group-foo" */ '../components/consultOnline.vue')

export default new Router({
    routes: [{
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'Home',
        component: Home,
        meta: {
            title: '首页',
            requiresAuth: true
        }
    },
    {
        path: '/chose/loanway',
        name: 'Loanway',
        component: Loanway,
        meta: {
            title: '选择贷款种类'
        }
    },
    {
        path: '/authentication',
        name: 'Authentication',
        component: Authentication,
        meta: {
            title: '身份验证'
        }
    },
    {
        path: '/auth/telphone',
        name: 'Authtelphone',
        component: Authtelphone,
        meta: {
            title: '身份验证'
        }
    },
    {
        path: '/chose/kind',
        name: 'Loankind',
        component: Loankind,
        meta: {
            title: '选择贷款种类'
        }
    },
    {
        path: '/repay/amount',
        name: 'Repaymoney',
        component: Repaymoney,
        meta: {
            title: '录入还款金额'
        }
    },
    {
        path: '/select/time',
        name: 'Selecttime',
        component: Selecttime,
        meta: {
            title: '选择办理时间'
        }
    },
    {
        path: '/book/success',
        name: 'Booksuccess',
        component: Booksuccess,
        meta: {
            title: '预约成功'
        }
    },
    {
        path: '/repay/confirm',
        name: 'Repayconfirm',
        component: Repayconfirm,
        meta: {
            title: '确定贷款余额'
        }
    },
    {
        path: '/change/loanway',
        name: 'Changeloanway',
        component: Changeloanway,
        meta: {
            title: '变更还款方式'
        }
    },
    {
        path: '/change/loantime',
        name: 'Changeloantime',
        component: Changeloantime,
        meta: {
            title: '变更还款日'
        }
    },
    {
        path: '/change/loandeadline',
        name: 'Changeloandeadline',
        component: Changeloandeadline,
        meta: {
            title: '变更还款期限'
        }
    },
    {
        path: '/change',
        name: 'Change',
        component: Change,
        meta: {
            title: '我要变更'
        }
    },
    {
        path: '/get',
        name: 'Get',
        component: Get,
        meta: {
            title: '我要领取'
        }
    },
    {
        path: '/consult',
        name: 'Consult',
        component: Consult,
        meta: {
            title: '我要咨询'
        }
    },
    {
        path: '/consult/online',
        name: 'Consultonline',
        component: Consultonline,
        meta: {
            title: '在线咨询'
        }
    }
    ]
})
